/**
 * 
 */
package org.dse.index;

import org.dse.analysis.Token;

/**
 * This interface provides methods to store keyword index to database.
 * 
 * The two methods are related. The addToken() method is used to add a token
 * associated with a specific html document to a temporary data structure in
 * memory. There may be some transforms and calculations on the data. The
 * createIndex() method is used to store all the tokens of the html document to
 * the permanent store.
 * 
 * @author zhangchen
 * 
 */
public interface IndexWriter {

	/**
	 * Add a token into the data structure, temporary in memory.
	 * 
	 * @param token
	 *            the token to be added
	 */
	public void addToken(Token token);

	/**
	 * Get the data from the data structure, add create a new keyword index
	 * object. Then, store it to the permanent store.
	 */
	public void createIndex();
}
